package enums;

public enum TablePosition {
	early, med, late;
	
	/**
	 * 
	 * @param position the position relative to the dealer
	 * @return
	 */
	public static TablePosition get(int position)
	{
		if(position == 0 || position > 7)
			return late;
		else if(position < 4)
			return med;
		else
			return early;
	}
	
	public static int getIndex(TablePosition tablePosition){

		int index = -1;
		for (int i = 0; i < TablePosition.values().length; i++) {
			if(tablePosition == TablePosition.values()[i]){
				index = i;
				return index;
			}
		}		
		return index;
	}
}
